import request from '@/utils/request'
import formurlencoded from 'form-urlencoded'


//获取移动端首页轮播图
export function fetchMBannerList(query) {
  return request({
    url: '/admin/mindex/banner/list',
    method: 'get',
    params: query
  })
}
//新增首页轮播图
export function createIndexBanner(data) {
  return request({
    url: '/admin/mindex/banner/create',
    method: 'post',
    data: formurlencoded(data)
  })
}
//跳转编辑首页轮播图
export function toUpdateIndexBanner(query) {
  return request({
    url: '/admin/mindex/banner/edit',
    method: 'get',
    params: query
  })
}

//更新首页轮播图
export function updateIndexBanner(data) {
  return request({
    url: '/admin/mindex/banner/update',
    method: 'post',
    data: formurlencoded(data)
  })
}


//删除
export function deleteBanner(data) {
  return request({
    url: '/admin/mindex/banner/delete',
    method: 'post',
    data: formurlencoded(data)
  })
}
//启用
export function upBanner(data) {
  return request({
    url: '/admin/mindex/banner/up',
    method: 'post',
    data: formurlencoded(data)
  })
}

//停用
export function downBanner(data) {
  return request({
    url: '/admin/mindex/banner/down',
    method: 'post',
    data: formurlencoded(data)
  })
}


//获取移动端多惠部落
export function fetchMRecommendList(query) {
  return request({
    url: '/admin/mindex/recommend/list',
    method: 'get',
    params: query
  })
}
//新增移动端多惠部落
export function createIndexRecommend(data) {
  return request({
    url: '/admin/mindex/recommend/create',
    method: 'post',
    data: formurlencoded(data)
  })
}
//跳转编辑移动端多惠部落
export function toUpdateIndexRecommend(query) {
  return request({
    url: '/admin/mindex/recommend/edit',
    method: 'get',
    params: query
  })
}

//更新移动端多惠部落
export function updateIndexRecommend(data) {
  return request({
    url: '/admin/mindex/recommend/update',
    method: 'post',
    data: formurlencoded(data)
  })
}


//删除
export function deleteRecommend(data) {
  return request({
    url: '/admin/mindex/recommend/delete',
    method: 'post',
    data: formurlencoded(data)
  })
}
//启用
export function upRecommend(data) {
  return request({
    url: '/admin/mindex/recommend/up',
    method: 'post',
    data: formurlencoded(data)
  })
}

//停用
export function downRecommend(data) {
  return request({
    url: '/admin/mindex/recommend/down',
    method: 'post',
    data: formurlencoded(data)
  })
}


//获取移动端楼层列表
export function fetchMFloorList(query) {
  return request({
    url: '/admin/mindex/floor/list',
    method: 'get',
    params: query
  })
}

// 新增楼层
export function createFloor(data) {
  return request({
    url: '/admin/mindex/floor/create',
    method: 'post',
    data: formurlencoded(data)
  })
}

// 编辑楼层
export function editFloor(query) {
  return request({
    url: '/admin/mindex/floor/edit',
    method: 'get',
    params: query
  })
}

// 编辑楼层-提交信息
export function updateFloor(data) {
  return request({
    url: '/admin/mindex/floor/update',
    method: 'post',
    data: formurlencoded(data)
  })
}



//删除
export function deleteFloor(data) {
  return request({
    url: '/admin/mindex/floor/delete',
    method: 'post',
    data: formurlencoded(data)
  })
}
//启用
export function upFloor(data) {
  return request({
    url: '/admin/mindex/floor/up',
    method: 'post',
    data: formurlencoded(data)
  })
}

//停用
export function downFloor(data) {
  return request({
    url: '/admin/mindex/floor/down',
    method: 'post',
    data: formurlencoded(data)
  })
}

//跳转首页楼层分类数据列表页
export function toMFloorDataList() {
  return request({
    url: '/admin/mindex/floordata',
    method: 'get'
  })
}

//获取移动端楼层分类数据列表
export function fetchMFloorDataList(query) {
  return request({
    url: '/admin/mindex/floordata/list',
    method: 'get',
    params: query
  })
}

//跳转新增楼层分类数据页
export function toAddMFloorData() {
  return request({
    url: '/admin/mindex/floordata/add',
    method: 'get'
  })
}

// 新增楼层分类数据
export function createFloorData(data) {
  return request({
    url: '/admin/mindex/floordata/create',
    method: 'post',
    data: formurlencoded(data)
  })
}
//选择商品弹出框
export function getProductsDialog(query) {
  return request({
    url: '/admin/product/list',
    method: 'get',
    params: query
  })
}
// 编辑楼层分类数据
export function editFloorData(query) {
  return request({
    url: '/admin/mindex/floordata/edit',
    method: 'get',
    params: query
  })
}
// 删除楼层分类数据
export function delFloorData(data) {
  return request({
    url: '/admin/mindex/floordata/delete',
    method: 'post',
    data: formurlencoded(data)
  })
}

// 编辑楼层分类数据-提交信息
export function updateFloorData(data) {
  return request({
    url: '/admin/mindex/floordata/update',
    method: 'post',
    data: formurlencoded(data)
  })
}
